package com.yejiali.backend.controller;

import com.yejiali.backend.response.Response;
import com.yejiali.backend.service.OCRService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Author:yejiali
 * @Date:2025/5/28-05-28-8:43
 * @Decsription:com.yejiali.backend.controller
 * @Version:1.0
 */
@RestController
@RequestMapping("/ocr")
@Tag(name = "病人信息管理", description = "病人信息接口")
public class OCRController {

    @Autowired
    private OCRService ocrService;

    /**
     * 身份证照识别信息
     * @return
     */
    @Operation(summary = "识别身份证信息", description = "识别身份证信息")
    @PostMapping("/idCard")
    public Response idCard(@RequestParam("idCard") MultipartFile file) throws IOException {
        return ocrService.idCard(file);
    }

    /**
     * 社保卡号识别
     */
    @Operation(summary = "识别社保卡信息", description = "识别社保卡信息")
    @PostMapping("/socialCard")
    public Response socialCard(@RequestParam("socialCard") MultipartFile file) throws IOException {
        return ocrService.socialCard(file);
    }




}
